package test.enums;

import java.io.Serializable;

public enum EncryptionSource implements Serializable {
	UNKNOWN(0), ELIG_WS(1), RSO_WS(2), LOGIN_WS(3);

	private EncryptionSource(int byteVal) {
		this.byteVal = (byte) byteVal;
	}

	final byte byteVal;

	/**
	 * @return the byteVal
	 */
	public byte getByteVal() {
		return byteVal;
	}

	/**
	 * @param byteVal
	 *            byteVal
	 * @return
	 */
	public static EncryptionSource fromByte(byte byteVal) {
		for (EncryptionSource src : values()) {
			if (src.byteVal == byteVal) {
				return src;
			}
		}
		return UNKNOWN;
	}
}